package com.dlut.java3;

import java.util.Scanner;

/**
 * @Author: LiuHeng
 * @Description:
 * @Date: 2022-09-14 21:02
 */
public class T0914_GuangLianDa {

    /*
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int k = in.nextInt();
        System.out.println(fun(n,m,k));
    }

    private static int fun(int k1, int k2, int k) {
        if (k > k1 * k2){
            return 500000;
        }
        if (k == 1)
            return 0;
        int n = Math.min(k1,k2);
        int m = Math.max(k1,k2);
        if (k <= n+ 1){
            return n*n + k-2;
        }
        int min = Integer.MAX_VALUE;
        int ans=0;
        for (int i = 1; i <= m / 2; i++) {
            for (int j = Math.min(k,n); j < k && j <= n * i; j++) {
                ans =fun(n,i,j) + fun(n, m - i,k-j) + n * n;
                min = Math.min(min,ans);
            }
        }
        for (int i = 1; i <= n / 2; i++) {
            for (int j = Math.min(k,m); j < k && j <= m * i; j++) {
                ans =fun(i,m,j) + fun(n-i, m,k-j) + m * m;
                min = Math.min(min,ans);
            }
        }
        return min;
    }
*/
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String st = in.nextLine();
        int t = Integer.parseInt(st);
        for (int iii = 0; iii < t; iii++) {
            String s = in.nextLine();
            char[] array = s.toCharArray();
            int n = s.length();
            int count = 0;
            int k3 = 0;
            for (int i = 0; i < n - 1; i++) {
                if (array[i] == array[i+1]){
                    int k1= i, k2 = i+1;
                    while (k1>=0 && k2<n && k1 >=k3){
                        if (array[k1]==array[k2]){
                            count++;
                            k1--;
                            k2++;
                        }else {
                            k3 = k2;
                            break;
                        }
                    }
                    i = k2 - 1;
                }
            }
            if (count % 2 == 1){
                System.out.println("Yes");
            }else{
                System.out.println("No");
            }
        }
    }

}
